﻿using SqlSugar;
using System;
using System.ComponentModel.DataAnnotations;

namespace Qy.Scenario;

[SugarTable(DbTableName.QyNotice)]

public class Notice
{
    [SugarColumn(IsPrimaryKey = true)]
    public int Id { get; set; }
    public string Title { get; set; }
    /// <summary>
    /// 通知类型  0 系统  1 用户
    /// </summary>
    public int Type { get; set; }
    public string Content { get; set; }
    public int PostUid { get; set; }
    public string Att { get; set; }
    public DateTime PostTime { get; set; }
}

public class EditNotice
{
    [Display(Name = "标题")]
    [Required(ErrorMessage = "标题未填写")]
    public string Title { get; set; }

    [Display(Name = "通知内容")]
    [Required(ErrorMessage = "内容未填写")]
    public string Content { get; set; }
    [Display(Name = "附件")]
    public string Att { get; set; }
    [Display(Name = "收件人")]
    [Required(ErrorMessage = "收件人未选择")]
    public string GetUid { get; set; }

}

public class ViewNotice
{
    public int Id { get; set; }
    public string Title { get; set; }
    public int Type { get; set; }
    public string Content { get; set; }
    public int Status { get; set; }
    public int GetUid { get; set; }
    public int PostUid { get; set; }
    public string Att { get; set; }
    public DateTime PostTime { get; set; }
    public DateTime ReadTime { get; set; }
    public string GetNickname { get; set; }
    public string PostAvatar { get; set; }
    public string GetUserAvatar { get; set; }
    public string PostNickname { get; set; }
    public int NoticeId { get; set; }
}

public class NoticeQuery : PagerInfo
{
    public int Id { get; set; }
    public int Uid { get; set; }
    public string Title { get; set; }
    public int Status { get; set; } = -1;
    public int ListType { get; set; }//空或1为收到消息列表,2是已发消息列表
}
